<template>
  <view class="goods-arguments">
    <uni-popup ref="popupRef" type="bottom" @maskClick="maskClist">
      <view class="goods-info">
        <view class="goods-name">
         商品参数
          <image src="../static/icon/shop/close.png" @tap="close" />
        </view>
        <view class="info">
          <image src="../static/icon/ti01.png" />
          <view class="info-right">
            <view class="price"> ￥<text>28.99</text></view>
            <view class="xl"> 销量：100</view>
            <view class="kc"> 库存：100</view>
          </view>
        </view>
        <view class="num">
          <view class="title">数量</view>
          <view class="min-add">
            <uni-icons type="minus-filled" size="20" color="#EEEEEE"/>
            <view>1</view>
            <uni-icons type="plus-filled" size="20" color="#FF3B1E"/>
          </view>
        </view>
        <!-- 套餐 -->
        <view class="meal">
          <view class="title"> 数量 </view>
          <view class="list">
            <view class="item"> 豪华套餐 </view>
            <view class="item"> 豪华套餐 </view>
            <view class="item"> 豪华套餐 </view>
            <view class="item"> 豪华套餐 </view>
          </view>
        </view>
        <!-- 口味 -->
        <view class="taste">
          <view class="title"> 口味 </view>
          <view class="list">
            <view class="item"> 7分糖 </view>
          </view>
        </view>
        <view class="btn" @tap="goPay"> 去结算 </view>
      </view>
    </uni-popup>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  const popupRef = ref()
  const open = () => {
    popupRef.value.open()
  }
  const close = () => {
    popupRef.value.close()
  }
  // 点击蒙版
  const maskClist = (e) => {
    console.log(e, 'maskClist');
  }
  // 去结算
  const goPay = () => {
    uni.navigateTo({ url: '/pages/orderConfirm/orderConfirm' })
  }
  defineExpose({
    open,
    close
  })
</script>

<style lang="scss" scoped>
  .goods-arguments {
    width: 100%;
    .goods-info {
      width: 100%;
      padding: 20px 12px;
      background: #FFFFFF;
      border-radius: 10px 10px 0px 0px;
      box-sizing: border-box;
      .goods-name {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 500;
        font-size: 16px;
        color: #333333;
        line-height: 19px;
        image {
          width: 20px;
          height: 20px;
        }
      }
      .info {
        display: flex;
        margin: 12px 0 18px 0;
        image {
          width: 80px;
          height: 80px;
          margin-right: 10px;
        }
        .info-right {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          padding-top: 10px;
          box-sizing: border-box;
          .price {
            font-weight: 600;
            font-size: 10px;
            color: #FF3B1E;
            text {
              font-size: 15px
            }
          }
          .xl, .kc {
            font-weight: 400;
            font-size: 12px;
            color: #999999;
            line-height: 11px;
          }
        }
      }
      .num {
        display: flex;
        justify-content: space-between;
        .title {
          height: 20px;
          font-weight: 400;
          font-size: 14px;
          color: #3D3D3D;
          line-height: 20px;
        }
        .min-add {
          display: flex;
          view {
            font-weight: 500;
            font-size: 14px;
            color: #3D3D3D;
            line-height: 16px;
            margin: 0 10px;
          }
        }
      }
      .meal, .taste {
        .title {
          margin: 20px 0 10px;
          height: 20px;
          font-weight: 400;
          font-size: 14px;
          color: #3D3D3D;
          line-height: 20px;
        }
        .list {
          display: flex;
          flex-wrap: wrap;
          .item {
            font-size: 14px;
            color: #333333;
            font-weight: 400;
            padding: 9px 20px;
            background: #F6F6F6;
            border-radius: 114px;
            margin: 0 10px 10px 0;
          }
        }
      }
      .btn {
        height: 50px;
        color: #FFFFFF;
        font-size: 17px;
        font-weight: 500;
        text-align: center;
        line-height: 50px;
        background: #FF3B1E;
        border-radius: 106px;
        margin-top: 12px;
      }
    }
  }
</style>